<?php
/**
 * Model de logs.
 *
 * @author    Fernanda Rebelatto <fernanda.rebelatto@gmail.com>
 * @copyright Copyright (c) 2012
 * @version   0.1
 */

class LogLeadControl extends AppModel
{
/**
     * @access public
     * @var string
     */
    public $table = 'ldct_log_lead_control';
    /**
     * @access public
     * @var string
     */
    public $primaryKey = 'log_id';
    public function gravarLog($pagina, $acao, $info='')
    {
        date_default_timezone_set('America/Sao_Paulo');
        if(isset($_SESSION['usua_id']))
            $this->data['usua_id'] = $_SESSION['usua_id'];
        else
            $this->data['usua_id'] = "";
        $this->data['log_pagina'] = $pagina;
        $this->data['log_acao'] = $acao;
        $this->data['log_info'] = $info;
        $this->data['log_datahora'] = date('Y-m-d H:i:s');
        $this->data['log_ip'] = $_SERVER["REMOTE_ADDR"];
        $this->save($this->data);
    }
}

?>

